package com.zoio.saike.dao;

import java.util.List;

import org.springframework.stereotype.Repository;
import javacommon.base.*;
import cn.org.rapid_framework.page.*;
import com.zoio.saike.model.*;
import com.zoio.saike.vo.query.*;

/**
 * @author Bryan.Zhang@ZOIO.NET
 * @date 1/2/2011
 */

@Repository
public class AmFileDao extends BaseIbatis3Dao<AmFile,java.lang.String>{
	
	@Override
	public String getIbatisMapperNamesapce() {
		return "AmFile";
	}
	
	public void saveOrUpdate(AmFile entity) {
		if(entity.getFileId() == null) 
			save(entity);
		else 
			update(entity);
	}
	
	@SuppressWarnings("unchecked")
	public Page<AmFile> findPage(AmFileQuery query) {
		return pageQuery("AmFile.findPage",query);
	}
	
	public List<AmFile> byName(String name){
		return this.getSqlSessionTemplate().selectList("AmFile.byname", name);
	}
	
	public List<AmFile> byName(String[] name){
		return this.getSqlSessionTemplate().selectList("AmFile.byname", name);
	}
}
